API Documentation
Public Member Functions | List of all members
nkGraphics::SamplerManager Class Referencefinal

Manages the samplers available in the component. More...

Inheritance diagram for nkGraphics::SamplerManager:

Public Member Functions

 ~SamplerManager ()
 
SamplercreateOrRetrieve (const std::string_view &name)
 
Samplerget (const std::string_view &name)
 
SamplergetByIndex (unsigned int id)
 
void rename (const std::string_view &oldName, const std::string_view &newName)
 
void erase (const std::string_view &name)
 

Detailed Description

Manages the samplers available in the component.

The manager owns all memory returned. External code should never delete it.

Constructor & Destructor Documentation

◆ ~SamplerManager()

nkGraphics::SamplerManager::~SamplerManager ( )

Destructor.

Member Function Documentation

◆ createOrRetrieve()

Sampler* nkGraphics::SamplerManager::createOrRetrieve ( const std::string_view &  name)

Creates if unavailable, or retrieves if available, a sampler.

Parameters
nameThe name of the sampler to use.
Returns
The sampler requested, possibly freshly created. The manager owns the memory, external code should never delete it. See erase().

◆ get()

Sampler* nkGraphics::SamplerManager::get ( const std::string_view &  name)

Retrieves an existing sampler.

Parameters
nameThe name of the sampler to retrieve.
Returns
The sampler requested if available, nullptr else.

◆ getByIndex()

Sampler* nkGraphics::SamplerManager::getByIndex ( unsigned int  id)

Retrieves a sampler by index. Note that an index can return a different sampler if the internal memory is modified. Mainly used for looping over all available samplers in one go.

Parameters
idThe index to use.
Returns
The linked sampler if available, nullptr else.

◆ rename()

void nkGraphics::SamplerManager::rename ( const std::string_view &  oldName,
const std::string_view &  newName 
)

Renames a sampler, changing both its name and way of addressing it in the manager.

Parameters
oldNameThe name of the sampler to move.
newNameThe new name to assign to the sampler.

◆ erase()

void nkGraphics::SamplerManager::erase ( const std::string_view &  name)

Erases a sampler and frees its memory.

Parameters
nameThe name of the sampler to erase.

The documentation for this class was generated from the following file: